<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>轮播图</title>
    <script src="./js/jquery.min.js"></script>
</head>
<style>
    * {
      padding: 0;
      margin: 0;
    }
    ul,
    ol {
      list-style: none;
    }
    #box{
        display: flex;
        width: 800px;
        height: 600px;
        margin: 100px auto;
        border: 1px solid #000;
    }
    #box li{
        position: relative;
        flex:1;
        perspective: 500000px;
        transform-style: preserve-3d;
        transition: all 1s ease;

    }
    #box li div {
      position: absolute;
      width: 100%;
      height: 100%;
      background-size: 800px 600px;
    }
    #box li div:nth-child(1) {
      background-image: url(./img/1.jpg);
      transform: translateZ(300px);
    }

    #box li div:nth-child(2) {
      background-image: url(./img/2.png);
      transform: rotateX(90deg) translateZ(300px);
    }

    #box li div:nth-child(3) {
      background-image: url(./img/3.jpg);
      transform: rotateX(180deg) translateZ(300px);
    }

    #box li div:nth-child(4) {
      background-image: url(./img/4.png);
      transform: rotateX(-90deg) translateZ(300px);
    }
    #btn {
        display: block;
        width: 100px;
        height: 50px;
        margin: 20px auto;
    }
</style>
<body>
    <ul id="box">
        <li class="list">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </li>
        <li class="list">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </li>
        <li class="list">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </li>
        <li class="list">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </li>
    </ul>
    <input type="button" id="btn" value="下一张">
</body>
<script>
    let x = 90;
    let lock = false;
    $btn = $("#btn");

    $btn.click(function(){
        if(lock){
            return;
        }
        lock = !lock;
        setTimeout(function(){
            lock = !lock;
        }, 1300);
        $("#box li").each(function(i){
            $(this).css({
                'transform': `rotateX(-${x}deg)`,
                'transition-delay': `${0.1*i}s`
            })
        });
        x += 90;
    });
</script>
</html>